//@ts-check
import { load } from 'cheerio';
import { reduce } from 'lodash-es';

const parse = (/** @type {string} */ str) => {
  const $ = load(str);
  const element = $('div').first();
  const attr = element.attr();
  console.log(`${element[0].name.toLocaleLowerCase()}${attr ? reduce(attr, (pre, v, k) => { return pre + `[${k}="${v}"]`; }, '') : ''}`);
};
[
  `<div
  class="MobileModal-wrapper"
  data-stop-scroll-propagation="true"
></div>`,
  `<div
  class="OpenInAppButton is-higher css-1zhsmz"
  style="opacity: 1; transform: none;"
></div>`
].forEach(parse);